from selenium import webdriver
from config import *
from page.mialList import MailListPage
import time

def my_login():
    """
    封装的登录方法
    :return:
    """
    driver = webdriver.Chrome("C:\Program Files\driver\chromedriver.exe")
    driver.maximize_window()
    driver.get(index_url)
    for cookie in cookies:
        driver.add_cookie(cookie)
    driver.refresh()
    return driver

# driver = my_login()
# print(driver.get_cookies())
# page = MailListPage(driver)
# page.get_mail_list_page()
# page.add_org('坚果')
# time.sleep(5)
# page.my_quit()

# driver = webdriver.Chrome("C:\Program Files\driver\chromedriver.exe")
# driver.maximize_window()
# driver.get(index_url)
# time.sleep(15)
# driver.get(index_url)
# print(driver.get_cookies())
